<script>
export default {
  name: "tab-bar",
  props:{
    tabIndex:{
      default:0
    }
  },
  data(){
    return{
      // tabIndex:0,
      tabBar:[
        {
          icon:'/static/driver/t1.png',
          selectIcon:'/static/driver/t1a.png',
          text:'抢单'
        },
        {
          icon:'/static/driver/t2.png',
          selectIcon:'/static/driver/t2a.png',
          text:'订单'
        },
        {
          icon:'/static/driver/t3.png',
          selectIcon:'/static/driver/t3a.png',
          text:'司机'
        }
      ]
    }
  }
}
</script>

<template>
<view class="tab-bar">
    <view v-for="(item,index) of tabBar" :key="index">
      <image :src="tabIndex===index?item.selectIcon:item.icon"></image>
      <text>{{item.text}}</text>
    </view>
</view>
</template>

<style scoped lang="scss">

</style>
